﻿// Decompiled with JetBrains decompiler
// Type: DnProcessSimulateCommands.ModularFixture.CCoMFFixtureDesignerApplicationCmd
// Assembly: DnProcessSimulateCommands, Version=2402.0.0.890, Culture=neutral, PublicKeyToken=null
// MVID: A885D881-AEDF-447E-852A-6F13102E089C
// Assembly location: C:\Program Files\Tecnomatix_2402\eMPower\DotNetCommands\DnProcessSimulateCommands.dll

using System.Resources;
using System.Windows.Forms;
using Tecnomatix.Engineering;


namespace DnProcessSimulateCommands.ModularFixture;

public class CCoMFFixtureDesignerApplicationCmd : TxButtonCommand
{
  private CCoMFFixtureDesignerApplicationCmdEnabler m_enabler;
  private CUiMFFixtureDesignerApplicationDlg m_designerDlg;

  public CCoMFFixtureDesignerApplicationCmd()
  {
    this.m_enabler = new CCoMFFixtureDesignerApplicationCmdEnabler();
  }

  public virtual void Execute(object cmdParams)
  {
    if ((TxApplication.ActiveDocument.PlatformGlobalServicesProvider as TxEmsGlobalServicesProvider).GetTypeMetaData("UnitConfigurationPrototype") == null)
    {
      int num = (int) TxMessageBox.Show(new ResourceManager("DnProcessSimulateCommands.Res.StringTable", ((object) this).GetType().Assembly).GetString("CUSTOMIZATION_NOT_IMPORTED_ERROR_MESSAGE"), this.GetResourceManager().GetString("DESIGNER_APPLICATION_CMD_NAME"), MessageBoxButtons.OK, MessageBoxIcon.Hand);
    }
    else if (this.m_designerDlg != null && this.m_designerDlg.IsOpened)
    {
      ((Control) this.m_designerDlg).Focus();
    }
    else
    {
      this.m_designerDlg = (CUiMFFixtureDesignerApplicationDlg) null;
      this.m_designerDlg = new CUiMFFixtureDesignerApplicationDlg();
      ((Control) this.m_designerDlg).Show();
    }
  }

  public virtual string Bitmap
  {
    get => this.GetResourceManager().GetString("DESIGNER_APPLICATION_CMD_BITMAP");
  }

  public virtual string Category
  {
    get => this.GetResourceManager().GetString("DESIGNER_APPLICATION_CMD_CATEGORY");
  }

  public virtual ITxCommandEnabler CommandEnabler => (ITxCommandEnabler) this.m_enabler;

  public virtual string Description
  {
    get => this.GetResourceManager().GetString("DESIGNER_APPLICATION_CMD_DESCRIPTION");
  }

  public virtual string Tooltip
  {
    get => this.GetResourceManager().GetString("DESIGNER_APPLICATION_CMD_TOOLTIP");
  }

  public virtual string Name
  {
    get => this.GetResourceManager().GetString("DESIGNER_APPLICATION_CMD_NAME");
  }

  public virtual bool Connect() => true;

  private ResourceManager GetResourceManager()
  {
    return new ResourceManager("DnProcessSimulateCommands.ModularFixture.FixtureDesigner.Res.StringTable", ((object) this).GetType().Assembly);
  }
}
